from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin

# Change the User administration page
admin.site.unregister(User)

class UserAdmin(UserAdmin):
    list_display = ('username', 'first_name', 'last_name', 'email')

    fieldsets = [
        (None,              {'fields': ['username', 'password']}),
        ('Personal Info',   {'fields': ['first_name', 'last_name', 'email']}),
        ('Permissions',     {'fields': ['is_active', 'is_staff', 'is_superuser', 'user_permissions'], 'classes': ['collapse']}),
        ('Groups',          {'fields': ['groups'], 'classes': ['collapse']}),
        ('Important Dates', {'fields': ['last_login', 'date_joined'], 'classes': ['collapse']}),
    ]


admin.site.register(User, UserAdmin)

